package com.example.module.iot.aws.config;

import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.validation.annotation.Validated;

import java.util.List;

@Data
@Validated // @Valid 不行
@ConfigurationProperties("mqtt.aws")
public class AwsMqttProperties {

    // General use
    @NotEmpty
    private String endpoint;
    @NotEmpty
    private String cert;
    @NotEmpty
    private String key;
    @NotEmpty
    private String ca;
    @NotEmpty
    private String clientId;
    @NotNull
    private Integer port;
    @NotNull
    private Integer mqtt_version;
    // Proxy
    private String proxyHost;
    private int proxyPort;
    // PubSub
    private String topic;
    private String message;
    private int count;
    // Websockets
    private String signingRegion;
    // Cognito
    private String cognitoIdentity;
    // Custom auth
    private String customAuthUsername;
    private String customAuthorizerName;
    private String customAuthorizerSignature;
    private String customAuthPassword;
    private String customAuthorizerTokenKeyName;
    private String customAuthorizerTokenValue;
    // Fleet provisioning
    private String templateName;
    private String templateParameters;
    private String csrPath;
    // Services (Shadow, Jobs, Greengrass, etc)
    private String thingName;
    private String mode;
    // Shadow specifics
    private String shadowProperty;
    private String shadowValue;
    private String shadowName;
    // Java Keystore
    private String keystore;
    private String keystorePassword;
    private String keystoreFormat;
    private String certificateAlias;
    private String certificatePassword;
    // Shared Subscription
    private String groupIdentifier;
    // PKCS#11
    private String pkcs11LibPath;
    private String pkcs11UserPin;
    private String pkcs11TokenLabel;
    private Long pkcs11SlotId;
    private String pkcs11KeyLabel;
    // Raw Connect
    private String username;
    private String password;
    private String protocolName;
    private List<String> authParams;
    // X509
    private String x509Endpoint;
    private String x509Role;
    private String x509ThingName;
    private String x509Cert;
    private String x509Key;
    private String x509Ca;
    // PKCS12
    private String pkcs12File;
    private String pkcs12Password;
    // Greengrass Basic Discovery
    private Boolean inputPrintDiscoverRespOnly;
    // Android KeyChain
    private String KeyChainAlias;
}
